.drawer-pusher
  = form_for Tenon::Asset.new, format: 'json', builder: Tenon::FormBuilder do |f|
    .toolbar
      = render 'tenon/shared/breadcrumbs'
      .toolbar__content
        .toolbar__actions.toolbar__actions--right
          - if policy(@asset).publish?
            %button.btn.toolbar__btn.submit{ data: { disable_with: "Please wait..." } } Save

          .toolbar__action
            %a.action-icon.dropdown-button{ href: '#!', data: { activates: 'form-dropdown'} }
              = i('more_vert')

        %ul.dropdown#form-dropdown
          - if @asset.persisted?
            %li.dropdown__item
              = link_to @asset, data: { method: :delete, confirm: 'Are you sure you want to delete this?' }, class: 'dropdown__action action-icon delete-link' do
                = i('delete')
                %span Delete

    %main
      = error_messages_for :asset

      = f.text_field :title, class: 'form-title-field', explanation: "Enter a title for your asset.  You can leave this blank to just use the file name as the title. #{defined?(multiple) ? 'If you upload multiple assets a numerical series will be created.' : '' }"

      .panel
        .panel__content
          .browse-button-holder
            .fileupload.btn.btn-secondary.browse
              %span#choose-files= defined?(multiple) ? 'Choose Files' : 'Choose File'
              %input{ type: 'file', class: 'upload', multiple: defined?(multiple) && multiple, style: 'width: 100%;', name: 'asset[attachment]' }

      .spacer
